<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var flag;

        function step(resolve, reject) {
            console.log("往事清零");
            if (flag) {
                resolve("打开游戏界面")
            } else {
                reject("手机没电,开启失败")
            }
        }

        function step1(resolve, reject) {
            console.log("进入游戏界面");
            if (flag) {
                resolve("选择游戏的模式")
            } else {
                reject("突然断网,强制退出")
            }

            function step2(resolve, reject) {
                console.log("进入组队页面");
                if (flag) {
                    resolve("ro")
                }
            }
    </script>
</body>

</html>